package com.edu.his.controller;

import com.edu.his.domain.Disease;
import com.edu.his.domain.MedicalRecord;
import com.edu.his.domain.Register;
import com.edu.his.service.MedicalRecordService;
import com.edu.his.service.RegisterService;
import com.edu.his.util.R;
import com.edu.his.vo.MedicalRecordVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 描述：
 * 创建人：飘
 * 创建时间：2024/12/19
 **/
@RestController
@RequestMapping("/physicianpatient")
@CrossOrigin(value = "*",maxAge = 3600)
public class PhysicianPatientController {
    @Autowired
    private RegisterService registerService;
    @Autowired
    private MedicalRecordService medicalRecordService;

    @PostMapping("/getrowcountregisterstate")
    public R getRowCountRegisterState(@RequestBody Register register) {
        return  this.registerService.getRowCountRegisterState(register);
    }

    @PostMapping("/insert")
    public R insert(@RequestBody MedicalRecordVO medicalRecord) {
        return  this.medicalRecordService.insert(medicalRecord,medicalRecord.getDisease());

    }
}
